<template>
    <scroll-view style="background-color: #f5f5f5">
        <div class="row" style="justify-content: center">
            <text>剩余支付时间 0:19:20</text>
        </div>
        <div style="height: 14px"></div>

        <OrderDetailInfo></OrderDetailInfo>
        <div style="height: 94px"></div>

        <div style="display: flex; flex-direction: column; align-items: center">
            <div class="buttonBlue">联系商家</div>
            <div style="height: 10px"></div>
            <div class="buttonGrey" @click="showDialog">取消订单</div>
        </div>
    </scroll-view>
    <div class="bottom" style="width: 100%">
        <div class="card shadow">
            <div class="row" style="align-items: center; justify-content: end; width: 100%">
                <div style="flex-grow: 1"></div>
                <text>合计：</text>
                <div class="row" style="align-items: center">
                    <div v-if="coins > 0" class="row">
                        <text class="moneyText" style="font-weight: bold"
                            >{{ coins }}<text class="moneyText" style="font-size: 10px">积分</text>
                        </text>
                    </div>
                    <img
                        v-if="coins > 0 && price > 0"
                        src="@/views/activityPages/assets/add5464.png"
                        style="width: 12px; height: 12px"
                    />
                    <text v-if="price > 0" class="moneyText" style="font-weight: bold"
                        >{{ price }}￥</text
                    >

                    <text v-if="price <= 0 && coins <= 0" class="moneyTextFree">免费</text>
                </div>
                <div style="width: 20px"></div>
                <div class="button" @click="onConfirm">立即支付</div>
            </div>
        </div>
        <uni-popup ref="popup" type="center"
            ><uni-popup-dialog
                mode="base"
                message="成功消息"
                title="提示"
                content="确定要取消支付订单吗?"
                :duration="2000"
                :before-close="true"
                @close="close"
                @confirm="confirm"
            ></uni-popup-dialog>
        </uni-popup>
    </div>
</template>

<script setup lang="ts">
import request from '@/utils/request'
import { defineComponent, reactive, ref, defineProps, getCurrentInstance } from 'vue'
import { onLaunch, onShow, onHide, onLoad } from '@dcloudio/uni-app'

import { useStore } from 'vuex'
import OrderDetailInfo from '@/views/activityPages/components/order-detail-info/'

const coins = ref(100)
const price = ref(100)
const popup = ref(null)
function showDialog() {
    popup.value.open()
}
function close() {
    popup.value.close()
}
function confirm() {
    console.log('confirm cancel')
    popup.value.close()
}
</script>

<style lang="scss" scoped>
@import url('@/views/activityPages/style/card.css');
.text1 {
    color: rgba(102, 102, 102, 1);
    font-size: 14px;
    text-align: left;
    font-family: PingFangSC-regular;
    font-weight: bold;
    padding-bottom: 5px;
}
.shadow {
    box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.4);
    padding-bottom: 20px;
}
.text2 {
    line-height: 14px;
    color: rgba(153, 153, 153, 1);
    font-size: 10px;
    text-align: left;
    font-family: PingFangSC-regular;
}

.row1 {
    justify-content: space-between;
    padding-bottom: 10px;
    width: 100%;
}
.buttonBlue {
    width: 327px;
    height: 29.34px;
    line-height: 17px;
    border-radius: 20px;
    background-color: rgba(0, 153, 255, 1);
    color: rgba(255, 255, 255, 1);
    font-size: 12px;
    text-align: center;
    font-family: Microsoft Yahei;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.buttonGrey {
    width: 327px;
    height: 29.34px;
    line-height: 17px;
    border-radius: 20px;
    background-color: rgba(194, 194, 194, 1);
    color: rgba(255, 255, 255, 1);
    font-size: 12px;
    text-align: center;
    font-family: Microsoft Yahei;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.button {
    width: 116px;
    height: 35px;
    line-height: 20px;
    border-radius: 20px;
    background-color: rgba(236, 106, 45, 1);
    color: rgba(255, 255, 255, 1);
    font-size: 14px;
    text-align: center;
    font-family: Microsoft Yahei;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
</style>
